dispose

open override fun dispose()

Releases all resources used by the video player (native players, coroutines, observers, etc.).

You do not need to call this manually when using rememberVideoPlayerState, which is the recommended way to create a player state in a composable. It automatically calls dispose via a DisposableEffect when the composable leaves the composition.

Only call this directly if you create the state manually via createVideoPlayerState outside of a composable lifecycle:

val state = createVideoPlayerState()
try {
// use the player...
} finally {
state.dispose()
}

After calling dispose, the state should not be reused.